home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / Dmod / dmod_P96 / examples / RequestModeID.d < prev    next >
Encoding:
Text File  |  2002-10-28  |  1.4 KB  |  46 lines

  1. /***********************************************************************
  2. * This is example shows how to use p96RequestModeIDTagList()
  3. *
  4. * tabt (Sat Dec 28 03:44:35 1996)
  5. *
  6. * Converted by Martin <MarK> Kuchinka, 13.9.2001
  7. ***********************************************************************/
  8.  
  9. MODULE    'picasso96','libraries/picasso96'
  10. MODULE    'graphics/displayinfo','utility/tagitem','graphics/modeid'
  11.  
  12. DEF    P96Base
  13.  
  14. PROC main()
  15.     IF P96Base:=OpenLibrary(P96NAME,2)
  16.         DEFUL    DisplayID
  17.         DEFL    width=640,
  18.                 height=480,
  19.                 depth=15
  20.  
  21.         DEF    ra,array=[0,0,0,0]:L
  22.         IF ra=ReadArgs('Width=W/N,Height=H/N,Depth=D/N',array,NIL)
  23.             IF array[0] THEN width :=^array[0]
  24.             IF array[1] THEN height:=^array[1]
  25.             IF array[2] THEN depth :=^array[2]
  26.             FreeArgs(ra)
  27.         ENDIF
  28.     
  29.         IF DisplayID:=p96RequestModeIDTags(
  30.                                         P96MA_MinWidth,       width,
  31.                                         P96MA_MinHeight,      height,
  32.                                         P96MA_MinDepth,       depth,
  33.                                         P96MA_WindowTitle,   'RequestModeID Test',
  34.                                         P96MA_FormatsAllowed, RGBFF_CLUT|RGBFF_R5G6B5|RGBFF_R8G8B8|RGBFF_A8R8G8B8,
  35.                                         TAG_DONE)
  36.             PrintF('DisplayID: %lx\n', DisplayID)
  37.             IF DisplayID<>INVALID_ID
  38.                 DEF    dim:DimensionInfo
  39.                 IF GetDisplayInfoData(NIL,dim,SIZEOF_DimensionInfo,DTAG_DIMS,DisplayID) THEN
  40.                     PrintF('Dimensions: %ldx%ldx%ld\n',dim.Nominal.MaxX-dim.Nominal.MinX+1,dim.Nominal.MaxY-dim.Nominal.MinY+1,dim.MaxDepth)
  41.             ENDIF
  42.         ENDIF
  43.         CloseLibrary(P96Base)
  44.     ENDIF
  45. ENDPROC
  46.